/**
 * <p>Copyright:Copyright(c) 2019</p>
 * <p>Company:Professional</p>
 * <p>Package:com.cesgroup.zw.spring.boot.echarts.model.style</p>
 * <p>File:ShadowStyle.java</p>
 * <p>类更新历史信息</p>
 * @todo chanlong(陈龙) 创建于 May 10, 2019 3:07:14 PM
 */
package com.cesgroup.zw.spring.boot.echarts.model.style;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;

import com.cesgroup.zw.spring.boot.supports.jackson.JavaScriptSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/**
 * <p>描述: 图形阴影样式</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date May 10, 2019 3:07:14 PM
 * @version 1.0.2019
 */
@Data @SuppressWarnings("serial")
public class ShadowStyle implements Serializable {

	/** 图形的颜色，[default: 自适应] */
	@JsonSerialize(using = JavaScriptSerializer.class)
	private Object color;
	
	/** 图形阴影颜色，[default: "transparent"] */
	private Object shadowColor;
	
	/** 图形阴影长度，[default: 0] */
	private Integer shadowBlur;
	
	/** 图形阴影 X 偏移，[default: 0] */
	private Integer shadowOffsetX;
	
	/** 图形阴影 Y 偏移，[default: 0] */
	private Integer shadowOffsetY;
	
	/** 图形的透明度，[default: 1] */
	private BigDecimal opacity;
	
	public void setOpacity(int opacity) {
		this.opacity = new BigDecimal(opacity).setScale(2, RoundingMode.HALF_UP);
	}
	
	public void setOpacity(double opacity) {
		this.opacity = new BigDecimal(opacity).setScale(2, RoundingMode.HALF_UP);
	}
}
